<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<title>Frequently Asked Questions</title>
<meta http-equiv="Content-Type" Content="text/html; charset=utf-8">
<link rel="stylesheet" type="text/css" href="../styles/styles.css">
<script language="javascript" src='links.js' type="text/javascript"></script>
</head>

<body>
<a name="top"></a>
<h1>Frequently Asked Questions</h1>
<div class=navbar>
<a href="index.html">main</a>
</div>


<h3>General questions</h3>
<ol>
  <li><a href="#cursor1">How can I hide the cursor?</a>
  <li><a href="#cursor2">How can I put it to the required position?</a>
  <li><a href="#editor1">How should I set the flags for plugin to work in the editor as well as in the panels: Info->Flags=?????;</a>
  <li><a href="#start">Is dynamic plugin connection/disconnection possible without FAR restart?</a>
  <li><a href="#editor2">Are plugins in the editor operable after activation only? Can I make a plugin work in the background mode?</a>
  <li><a href="#many1">Can I merge several plugins (or functions) into one DLL module?...</a>
  <li><a href="#many2">...and then recognize the user's choice using the Item parameter of OpenPlugin function? Am I right?</a>
  <li><a href="#background1">Can I make a plugin that works in the background mode using the current API?</a>
  <li><a href="#file">I have a file that can be processed by a plugin. How can I find that out?...</a>
  <li><a href="#path">How can I get the full plugin module path from within it?</a>
  <li><a href="#background2">Can I switch FAR background screens from the plugin?</a>
  <li><a href="#clipboard">How does FAR determine that the block in the Clipboard is a vertical block?</a>
  <li><a href="#cpos">Is it possible to recognize where the cursor is set on the current panel?...</a>
  <li><a href="#panelcaption">Can I redraw the window caption while redrawing any panel?...</a>
  <li><a href="#funcCM">Where does FAR get the procedures from for file copying/deletion/... ?</a>
  <li><a href="#FARDir">How can I get the name of the folder from which FAR was started?</a>
  <li><a href="#PlReduce">How can I reduce the size of the DLL?...</a>
  <li><a href="#ClipDup">There are dupes in the Clipboard, why should FAR put there the same stuff several times?</a>
  <li><a href="#symlink1">How can I determine what is the "symbolic link"?...</a>
  <li><a href="#symlink2">...what '\\?\Volume{...' hides inside?</a>
  <li><a href="#symlink3">Can I get some more useful info about symbolic links?</a>
  <li><a href="#editor3">Can I get the changed/unchanged flags for the file being edited?...</a>
  <li><a href="#viewer1">How can I get the name of the file loaded in viewer?</a>
  <li><a href="#fsf1">Is it possible in FSF.ProcessName to get TRUE, when comparing...</a>
  <li><a href="#kbd1">How does Windows dump the file name from the Explorer to the console window?</a>
  <li><a href="#panel1">ProcessKey doesn't work for some reason...</a>
  <li><a href="#panel2">How can a plugin position the cursor on a specific file?</a>
  <li><a href="#exec1">How can a plugin run a program? And show its output under the panels?</a>

</ol>

<h3>Dialogs</h3>
<ol>
  <li><a href="#edit512">Can I somehow overcome the edit window limitation, where the macro sequence is limited to <u>512 characters</u>?</a>
  <li><a href="#dialog1">If I don't use the Dialog function to work with dialog, how can I handle the data input? Should I write that myself?</a>
  <li><a href="#dialog2">If I use the Dialog function and an input line within it, will the ProcessEditorInput and ProcessEditorEvent functions work for this control element?</a>
  <li><a href="#dialog3">Can I change elements like Static (their captions) dynamically in a dialog?</a>
  <li><a href="#dialog4">The set of control elements handled by FAR isn't sufficient for me...</a>
  <li><a href="#dialog5">Why the ListBox and ComboBox are so crude?...</a>
  <li><a href="#dialog6">Why the buttons for closing the window don't work in the "new-style" dialog?</a>
  <li><a href="#dialog7">Should I close the dialog myself from now on?</a>
  <li><a href="#dialog8">If I use the mouse, should I catch the DN_MOUSECLICK?</a>
  <li><a href="#dialog9">Should I handle the DefaultButton myself as well?</a>
  <li><a href="#dialog10">In no way the SEPARATOR can reach the frame right edge...</a>
  <li><a href="#dialog11">Can I somehow disable the automatic selection of elements using mouse in lists?...</a>
</ol>


<h3>General questions</h3>
<ol>
  <li><span class=faqq>Q:</span> <a name="cursor1"><span class=faqqb>How can I hide the cursor?</span></a>
  <br><span class=faqa>A:</span> Win32 console API: <a href="win32/setconsolecursorinfo.html">SetConsoleCursorInfo</a>, but don't forget to bring it back.<br><br>
  <li><span class=faqq>Q:</span> <a name="cursor2"><span class=faqqb>How can I put it to the required position?</span></a>
  <br><span class=faqa>A:</span> There: <a href="win32/setconsolecursorposition.html">SetConsoleCursorPosition</a><br><br>
  <li><span class=faqq>Q:</span> <a name="editor1"><span class=faqqb>How should I set the flags for plugin to work in the editor as well as in the panels: Info->Flags=?????;</span></a>
  <br><span class=faqa>A:</span> <a href="structures/plugininfo.html#PF_EDITOR">PF_EDITOR</a><br><br>
  <li><span class=faqq>Q:</span> <a name="start"><span class=faqqb>Is dynamic plugin connection/disconnection possible without FAR restart?</span></a>
  <br><span class=faqa>A:</span> Disconnection is impossible. Why do you want to disconnect it? Connections are handled by FAR itself. You can still ask FAR not to cache
  the configuration of that plugin, but to load it to memory every time FAR starts by specifying the <a href="structures/plugininfo.html#PF_PRELOAD">PF_PRELOAD</a> flag.
  But it will be better for you not to do that since it leads to delays and extra memory consumption.<br><br>
  <li><span class=faqq>Q:</span> <a name="editor2"><span class=faqqb>Are plugins in the editor operable after activation only? Can I make a plugin work in the background mode?</span></a>
  <br><span class=faqa>A:</span> Yes, you can. Export the <a href="exported_functions/processeditorinput.html">ProcessEditorInput</a>, and it will intercept all keyboard events in the editor.<br><br>
  <li><span class=faqq>Q:</span> <a name="many1"><span class=faqqb>Can I merge several plugins (or functions) into one DLL module? And call each of them as if it was in a separate DLL-file (even if I load that DLL every time)...</span></a>
  <br><span class=faqa>A:</span> Yes, you can. In the <a href="structures/plugininfo.html">PluginInfo</a> you can specify several strings that will be added to the Plugins menu. But
  it violates the rules of <a href="rules.html#RulesMultiMenu">professional ethics</a>.<br><br>

  <li><span class=faqq>Q:</span> <a name="many2"><span class=faqqb>...and then recognize the user's choice using the Item parameter of OpenPlugin function? Am I right?</span></a>
  <br><span class=faqa>A:</span> You're right.<br><br>
  <li><span class=faqq>Q:</span> <a name="background1"><span class=faqqb>Can I make a plugin that works in the background mode using the current API?</span></a>
  <br><span class=faqa>A:</span> In the editor only. There's no support for doing that in panels.<br><br>
  <li><span class=faqq>Q:</span> <a name="file"><span class=faqqb>I have a file that can be processed by a plugin. How can I find that out? I think it would be better to send the cd command there and get the answer - was it able to do that or not.</span></a>
  <br><span class=faqa>A:</span> You can't do this since there's no API for plugin interaction in FAR. A simple check for file belonging to a plugin is not sufficient.<br><br>
  <li><span class=faqq>Q:</span> <a name="path"><span class=faqqb>How can I get the full plugin module path from within it?</span></a>
  <br><span class=faqa>A:</span> FAR passes the pointer in the <a href="structures/pluginstartupinfo.html">PluginStartupInfo</a> structure to the <a href="exported_functions/setstartupinfo.html">SetStartupInfo</a> function. Full module path is in the ModuleName field of that structure.<br><br>
  <li><span class=faqq>Q:</span> <a name="background2"><span class=faqqb>Can I switch FAR background screens from the plugin?</span></a>
  <br><span class=faqa>A:</span> You can do it beginning from the FAR Manager 1.70 beta 4.<br><br>
  <li><span class=faqq>Q:</span> <a name="clipboard"><span class=faqqb>How does FAR determine that the block in the Clipboard is a vertical block?</span></a>
  <br><span class=faqa>A:</span> Vertical block has "FAR_VerticalBlock" Clipboard format.<br><br>
  <li><span class=faqq>Q:</span> <a name="cpos"><span class=faqqb>Is it possible to recognize where the cursor is set on the current panel? In particular, at the folder or at the file...</span></a>
  <br><span class=faqa>A:</span><pre class=code>Control(<a href="service_functions/control.html#FCTL_GETANOTHERPANELINFO">FCTL_GETANOTHERPANELINFO</a>);
Control(<a href="service_functions/control.html#FCTL_GETPANELINFO">FCTL_GETPANELINFO</a>);
<a href="structures/panelinfo.html">PanelInfo</a>.PanelItems[PanelInfo.CurrentItem].<a href="./winapi/win32_find_data.html">FindData.dwFileAttributes</a>
</pre></li>

  <li><span class=faqq>Q:</span> <a name="panelcaption"><span class=faqqb>Can I redraw the window caption while redrawing <u>any</u> panel? I think it would be easier and faster than calling FCTL_REDRAWPANEL</span></a>.
  <br><span class=faqa>A:</span> It won't necessarily be faster. If the caption was not changed by the plugin (it's usual practice), there's no need to redraw it.<br><br>
  <li><span class=faqq>Q:</span> <a name="funcCM"><span class=faqqb>Where does FAR get the procedures from for file copying/deletion/... ?</span></a>
  <br><span class=faqa>A:</span> It gets them from Win32 API.<br>
  <u>Copying:</u> <a href="win32/CreateFile.html">CreateFile</a>+<a href="win32/ReadFile.html">ReadFile</a>+<a href="win32/writefile.html">WriteFile</a>+<a href="win32/closehandle.html">CloseHandle</a> or <a href="win32/copyfile.html">CopyFile</a>(Ex), depending on the operating system and the "Use system copy routine" option.<br>
  <u>Deletion:</u> <a href="win32/DeleteFile.html">DeleteFile</a> or <a href="win32/shfileoperation.html">SHFileOperation</a>, depending on the "Delete to Recycle Bin" option.<br><br>
  <li><span class=faqq>Q:</span> <a name="FARDir"><span class=faqqb>How can I get the name of the folder from which FAR was started?</span></a>
  <br><span class=faqa>A:</span> <pre class=code>char lpName[_MAX_PATH], lpFullPath[_MAX_PATH];
LPTSTR lpFile;
<a href="win32/GetModuleFileName.html">GetModuleFileName</a>(NULL,lpName,sizeof(lpName));
<a href="win32/GetFullPathName.html">GetFullPathName</a>(lpName,sizeof(lpFullPath),lpFullPath,&amp;lpFile);
*lpFile='\0';</pre><br>
  <li><span class=faqq>Q:</span> <a name="PlReduce"><span class=faqqb>How can I reduce the size of the DLL - the module is so heavy?</span></a>
  <br><span class=faqa>A:</span><ol>
    <li>There are some notes regarding that in the "<a href="articles/index.html">Articles</a>" topic.
    <li>The writers of plugins who use Visual C++ and want to reduce the plugin module size
    are strongly advised to read this:
    <a href="http://msdn.microsoft.com/msdnmag/issues/01/01/hood/default.aspx">http://msdn.microsoft.com/msdnmag/issues/01/01/hood/default.aspx</a>
    (local copy is <a href="articles/bonus/msdnmag-issues-01-01-hood-default.aspx.html">here</a>)
  </ol><br>
  </li>

  <li><span class=faqq>Q:</span> <a name="ClipDup"><span class=faqqb>There are dupes in the Clipboard, why should FAR put there the same stuff several times?</span></a>
  <br><span class=faqa>A:</span> If the text in the Clipboard is in any particular format,
  but the program wants another one, Windows does the conversion itself, and
  sometimes does this incorrectly. The pseudographics gets corrupted in this case,
  russian symbols are converted into '?' sometimes. The bugs depend on the Windows
  version and initial/final formats combination.
  If all the formats are in the Clipboard together, Windows finds the necessary one
  and uses it without any conversions.<br><br>
  </li>

  <li><span class=faqq>Q:</span> <a name="symlink1"><span class=faqqb>How can I determine what is the "symbolic link" - a simple directory link or a mounted volume?</span></a>
  <br><span class=faqa>A:</span> The main rule: symbolic links on Win2K are <b>FOR DIRECTORIES ONLY!</b>
   So, we need to know - "<em>Is THIS a directory?</em>".
   We can use <code>FA_DIREC</code> (or <code>FILE_ATTRIBUTE_DIRECTORY</code>) file attribute to do that.

  <br>Let's continue.

  <br>We know for sure that any symbolic link (or reparse point) in
   Win2K has a <code>FILE_ATTRIBUTE_REPARSE_POINT</code> attribute - so let's check it.

  <br>Call<br>
     <pre class=code><a href="fsf/getreparsepointinfo.html">FSF.GetReparsePointInfo</a>(FullFolderName,DestName,sizeof(DestName))</pre>
  This function returns real "DestName" for specified "FullFolderName", specifically:
   <ol>
   <li><code>"\??\D:\Junc..."</code><br>
      directory junction.

   <li><code>"\\?\Volume{..."</code><br>
      mounted volume.
   </ol>

  <br>Moreover, the first 4 symbols are irrelevant for us! Therefore it is enough to check
   7 symbols beginning from the 4th:
   <pre class=code>if(!strncmp(JuncName+4,"Volume{",7))
{
  // obviously, this is a mounted volume!
}
else
{
  // an ordinary directory junction.
}</pre><br><br>
  </li>

  <li><span class=faqq>Q:</span> <a name="symlink2"><span class=faqqb>But it's interesting what '\\?\Volume{...' hides inside?</span></a>
  <br><span class=faqa>A:</span> It's easy as a pie. Call the
  <pre class=code><a href="fsf/getpathroot.html">FSF.GetPathRoot</a>(JuncName,Root);</pre> function
   that returns the real root directory in one of two forms:
   <ol>
   <li><code>"D:\"</code><br>
   <li><code>"\\?\Volume{..."</code><br>
   </ol>
   <br>The second case is turbid :-) - apparently at the system level (from the disk manager) someone has deleted
   the letter assigned to this disk... One might say, in order not to see it ;-)<br><br></li>


  <li><span class=faqq>Q:</span> <a name="symlink3"><span class=faqqb>Can I get some more useful info about symbolic links?</span></a>
  <br><span class=faqa>A:</span> Of course you can :-) Really, not entirely about symbolic links, but...
  <br>We can, for example, get a portion of information about the mounted volumes.
   It's simple - call the standard <a href="win32/GetVolumeInformation">GetVolumeInformation()</a> function.
   <br>In other words, we know the root already - <code>"GetPathRoot(JuncName,Root);"</code>,
   it remained only to get the information (e.g., file system extended attributes support
   - compression, encryption, and file system type):
   <pre class=code>DWORD FileSystemFlags;
char FSysName[NM];

if (GetVolumeInformation(Root,NULL,0,NULL,NULL,
                        &amp;FileSystemFlags,FSysName,sizeof(FSysName)))
{
  if (FileSystemFlags &amp; FS_FILE_COMPRESSION)
  {
    // file system supports file compression
  }

  if (FileSystemFlags &amp; FS_FILE_ENCRYPTION)
  {
    // file system supports file encryption
  }
}</pre>

   <br>A typical function to check the ability of hard link creation looks like that:

    <pre class=code>BOOL CanCreateHardLinks(char *TargetFile,char *HardLinkName)
{
  char RootTarget[NM],RootHardLink[NM],FSysName[NM];
  GetPathRoot(TargetFile,RootTarget);
  GetPathRoot(HardLinkName,RootHardLink);

  if(!strcmp(RootTarget,RootHardLink)) // the same root (the same volume)?
  {
    // NTFS drive?
    DWORD FileSystemFlags;

    if(GetVolumeInformation(RootTarget,NULL,0,NULL,NULL,&amp;FileSystemFlags,
                            FSysName,sizeof(FSysName)))
    {
      if(!strcmp(FSysName,"NTFS"))
        return TRUE;
    }
  }
  return FALSE;
}</pre><br><br></li>

  <li><span class=faqq>Q:</span> <a name="editor3"><span class=faqqb>Can I get the changed/unchanged flags for the file being edited? I didn't find that, but FAR knows about that and displays an asterisk in the first line.</span></a>
  <br><span class=faqa>A:</span> See the <a href="structures/editorinfo.html#ECSTATE_MODIFIED">EditorInfo</a> structure description,
     specifically the EditorInfo.CurState field values.<br><br>

  <li><span class=faqq>Q:</span> <a name="viewer1"><span class=faqqb>How can I get the name of the file loaded in viewer?</span></a>
  <br><span class=faqa>A:</span> This code gets the current file name in the viewer:
<pre class=code>WindowInfo wi;
wi.Pos=-1;
Info.AdvControl(Info.ModuleNumber,ACTL_GETWINDOWINFO,&amp;wi);</pre>
  That's all. File name is in wi.Name.<br><br></li>


  <li><span class=faqq>Q:</span> <a name="fsf1"><span class=faqqb>Is it possible in FSF.ProcessName to get TRUE, when comparing "OUTBOUND\\????????.MO?"
   mask and "C:\\FILES\\OUTBOUND\\0000ee2c.mod" file, but to get FALSE with "C:\\MUSIC\\assol_1.mod"?
   PN_SKIPPATH is a wrong approach. When "\\" is in the mask it won't ever return TRUE.</span></a>
  <br><span class=faqa>A:</span> Compare with the "*\\OUTBOUND\\????????.MO?" mask without using the
  <a href="fsf/processname.html#PN_SKIPPATH">PN_SKIPPATH</a>.
  <br><br></li>

  <li><span class=faqq>Q:</span> <a name="kbd1"><span class=faqqb>How does Windows dump the file name from the Explorer to the console window?</span></a>
  <br><span class=faqa>A:</span>
  Vasily Titsky: "<em>...Briefly, when inserting text into the console application
   (through the system menu or through the link drag-and-drop) the kind OS does the following:
   if the next symbol code is not within the current application Keyboard Layout
   (current language is English, but we need to insert a Russian symbol; or vice versa),
   system "emulates" the input of this symbol through the Alt+digits. For example, when inserting Russian
   'A' , the following will be generated: press Alt, press '1', release '1', press '2', release '2',
   press '8', release '8', release Alt.
   When inserting symbols with codes below 99 (? - I didn't check this) the pressing of two
   digits is generated. We only have to detect it correctly and then handle it...</em>"
  <br><br></li>

  <li><span class=faqq>Q:</span> <a name="panel1"><span class=faqqb>ProcessKey doesn't work for some reason...</span></a>
I write in Delphi:
<pre class=code>function ProcessKey(hPlugin: THandle; Key: Integer; ControlState: Word): integer; stdcall;
begin
  windows.Beep(300,200);
  //return False in order to be processed by FAR itself
  result:=0;
end;
</pre>
    Any key pressing should be followed by a beep - but there are no beeps. The same is for any particular key.
  <br>
  <span class=faqa>A:</span> FAR calls the <a href="exported_functions/processkey.html">ProcessKey</a> function for the active plugin panel only.
  <br><br></li>

  <li><span class=faqq>Q:</span> <a name="panel2"><span class=faqqb>How can a plugin position the cursor on a specific file?</span></a>
  <br><span class=faqa>A:</span>
<pre class=code>
{
  struct PanelInfo PInfo;
  Info.Control(INVALID_HANDLE_VALUE,FCTL_GETPANELINFO,&amp;PInfo);

  // set cursor position on the selectItem panel item

  struct PanelRedrawInfo PRI;
  char Name[NM], Dir[NM*5];
  int pathlen;

  strcpy(Name,Info.FSF-&gt;PointToName(selectItem));
  pathlen=Info.FSF-&gt;PointToName(selectItem)-selectItem;

  if(pathlen)
    memcpy(Dir,selectItem,pathlen);

  Dir[pathlen]=0;
  Info.FSF-&gt;Trim(Name);
  Info.FSF-&gt;Trim(Dir);
  Info.FSF-&gt;Unquote(Name);
  Info.FSF-&gt;Unquote(Dir);

  if(*Dir)
    Info.Control(INVALID_HANDLE_VALUE,FCTL_SETPANELDIR,&amp;Dir);
  Info.Control(INVALID_HANDLE_VALUE,FCTL_GETPANELINFO,&amp;PInfo);

  PRI.CurrentItem=PInfo.CurrentItem;
  PRI.TopPanelItem=PInfo.TopPanelItem;

  for(int J=0; J &lt; PInfo.ItemsNumber; J++)
  {
    if(!Info.FSF-&gt;LStricmp(Name,Info.FSF-&gt;PointToName(PInfo.PanelItems[J].FindData.cFileName)))
    {
      PRI.CurrentItem=J;
      PRI.TopPanelItem=J;
      break;
    }
  }
  Info.Control(INVALID_HANDLE_VALUE,FCTL_REDRAWPANEL,&amp;PRI);
}
</pre>
  <br><br></li>

  <li><span class=faqq>Q:</span> <a name="exec1"><span class=faqqb>How can a plugin run a program? And show its output under the panels?</span></a>
  <br><span class=faqa>A:</span>
<pre class=code>Info.Control(INVALID_HANDLE_VALUE,FCTL_GETUSERSCREEN,NULL);

if (CreateProcess(NULL,"ls.exe",NULL,NULL,TRUE,0,NULL,NULL,&amp;si,&amp;pi))
{
  WaitForSingleObject( pi.hProcess, INFINITE );
  CloseHandle( pi.hProcess );
  CloseHandle( pi.hThread );
}

Info.Control(INVALID_HANDLE_VALUE,FCTL_SETUSERSCREEN,NULL);
</pre>
  <br><br></li>
</ol>


<div class=seecont><a href="#top">To the top</a><br><br><br></div>


<h3>Dialogs</h3>
<ol>
  <li><span class=faqq>Q:</span> <a name="edit512"><span class=faqqb>Can I somehow overcome the edit window limitation, where the macro sequence is limited to <u>512 characters</u>?</span></a>
  <br><span class=faqa>A:</span> It's the FAR dialog property. In the <a href="dialogapi/structures/fardialogitem.html">FarDialogItem</a> structure the Data field size is 512 characters.
   (the answer is relevant for FAR Manager 1.70 beta 2 and earlier; see the <a href="dialogapi/flags/dif_varedit.html">DIF_VAREDIT</a> flag description)<br><br>

  <li><span class=faqq>Q:</span> <a name="dialog1"><span class=faqqb>If I don't use the Dialog function to work with dialog, how can I handle the data input? Should I write that myself?</span></a>
  <br><span class=faqa>A:</span> You can write that yourself :-) But you can also use the <a href="dialogapi/index.html">DialogAPI</a>...<br><br>
  <li><span class=faqq>Q:</span> <a name="dialog2"><span class=faqqb>If I use the Dialog function and an input line within it, will the ProcessEditorInput and ProcessEditorEvent functions work for this control element?</span></a>
  <br><span class=faqa>A:</span> No, they won't. Use the <a href="dialogapi/dialogex.html">DialogEx</a> function instead.<br><br>
  <li><span class=faqq>Q:</span> <a name="dialog3"><span class=faqqb>Can I change elements like Static (their captions) dynamically in a dialog?</span></a>
  <br><span class=faqa>A:</span> It depends on the dialog type used. After the dialog creation and
      <a href="dialogapi/dialog.html">Dialog</a> function call, you can't. But you can close the dialog,
      change its caption and recreate the dialog. If you do all that in a sequence it will be rather fast.<br>
      If you use the <a href="dialogapi/dialogex.html">DialogEx</a> function, you can send the
      <a href="dialogapi/dmsg/dm_settext.html">DM_SETTEXT</a> message to the DialogAPI
      from the function that handles the dialog.<br><br>
  <li><span class=faqq>Q:</span> <a name="dialog4"><span class=faqqb>OK, I use the DialogAPI, but the set of control elements handled by FAR isn't sufficient for me.</span></a>
  <br><span class=faqa>A:</span> Use the <a href="dialogapi/controls/di_usercontrol.html">DI_USERCONTROL</a> element. It handles the element drawing and controls it - the plugin can do all the stuff!<br><br>
  <li><span class=faqq>Q:</span> <a name="dialog5"><span class=faqqb>Why the ListBox and ComboBox are so crude? I can't deal with them in a usual way - I have to extricate from this problem in order to add or delete them.</span></a>
  <br><span class=faqa>A:</span> What do you want from the very first version of the DialogAPI?<br><br>
  <li><span class=faqq>Q:</span> <a name="dialog6"><span class=faqqb>Why the buttons for closing the window don't work in the "new-style" dialog?</span></a>
  <br><span class=faqa>A:</span> "Old-style" ones don't have a handler. It's no wonder that their behavior should be the same as in FAR 1.65 and earlier.<br>
  "New-style" ones use a handler. You should handle the dialog closing yourself, except for: Ctrl-Break - always closes, Ctrl-Enter - closes if there exists at least one button with field DefaultButton=1, then a <a href="dialogapi/dmsg/dm_close.html">Close request</a> with Param1 = current element number, Esc and F10 can be handled from the handler - should the dialog close or not.<br><br>
  <li><span class=faqq>Q:</span> <a name="dialog7"><span class=faqqb>Should I close the dialog myself from now on?</span></a>
  <br><span class=faqa>A:</span> If you use a dialog handler - YES, you should: catch the <a href="dialogapi/dmsg/dn_btnclick.html">DN_BTNCLICK</a> event,  check Param1 for match with required number and send the <a href="dialogapi/dmsg/dm_close.html">DM_CLOSE</a> message to the dialog core.<br><br>
  <li><span class=faqq>Q:</span> <a name="dialog8"><span class=faqqb>If I use the mouse, should I catch the DN_MOUSECLICK?</span></a>
  <br><span class=faqa>A:</span> It's to your discretion :-) First, a mouse message comes (ignore it), then the DN_BTNCLICK comes right after it...<br><br>
  <li><span class=faqq>Q:</span> <a name="dialog9"><span class=faqqb>Should I handle the DefaultButton myself as well?</span></a>
  <br><span class=faqa>A:</span> No, you don't have to. For DefaultButton, the sequence is like that: [<a href="dialogapi/dmsg/dn_mouseclick.html">DN_MOUSECLICK</a> -> ] <a href="dialogapi/dmsg/dn_btnclick.html">DN_BTNCLICK</a> -> <a href="dialogapi/dmsg/dm_close.html">DM_CLOSE</a>.<br><br>
  <li><span class=faqq>Q:</span> <a name="dialog10"><span class=faqqb>Somehow it turned out that in no way the SEPARATOR could reach the frame right edge, but it got recovered when I rewrote everything  from scratch.</span></a>
  <br><span class=faqa>A:</span> See the comments for the <a href="dialogapi/flags/dif_separator.html">DIF_SEPARATOR</a> flag.<br><br>

  <li><span class=faqq>Q:</span> <a name="dialog11"><span class=faqqb>Can I somehow disable the automatic selection of elements using mouse in lists (when mouse hovering over the list selects the element, particularly if this list is not active)?</span></a>
  <br><span class=faqa>A:</span> Partially, you can. See the <a href="dialogapi/dmsg/dm_listsetmousereaction.html">DM_LISTSETMOUSEREACTION</a><br><br>


</ol>

<div class=seecont><a href="#top">To the top</a></div>
</body>
</html>
